//MyMath.java
package org.example.demo3.spring;

import lombok.Data;
import org.springframework.stereotype.Component;

@Component("target")
@Data
public class MyMath {
    int n1,n2,result;

    public void add() {
        result = n1 + n2;
        System.out.println(result);
    }

    public void subtract() {
        result = n1 - n2;
        System.out.println(result);
    }

    public void multiply() {
        result = n1 * n2;
        System.out.println(result);
    }

    public void divide() {
        result = n1 / n2;
        System.out.println(result);
    }

}
